function post()
{
  var username=$('#username').val();
  var password=$('#password').val();
  alert(username);
  alert(password);

 $.post('validate.php',{postname:username,pass:password},
    function(data)
    {
        if(data=="0")
        {
            $('#result').html("The email or password you entered is incorrect.");
        }
        else
        {
            window.location.href="main.php";
        }
    });
}